<template>
	<view class="radio-container">
		<view :class="{'c-radio':true,'pitch':radioShow}" :style="{width:size+'rpx',height:size+'rpx'}" @click="radioClick">
			<view :style="{'background-color':centerColor}" :class="{'c-radio-pitch':true,'pitch':radioShow}"></view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			show: {
				type:Boolean,
				default:false
			},
			size: {
				type:String|Number,
				default:32
			},
			centerColor: {
				type:String,
				default:'white'
			},
			activeColor: {
				type:String,
				default:'#25c376'
			}
		},
		computed: {
			radioShow: {
				get() {
					return this.show
				}
			}
		},
		methods: {
			radioClick() {
				this.$emit('change',this.show)
			}
		}
	}
</script>

<style scoped lang="scss">
	.c-radio {
		border: 1px solid rgb(154,154,154);
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		.c-radio-pitch {
			width: 70%;
			height: 70%;
			border-radius: 50%;
			transition: all .15;
		}
		.c-radio-pitch.pitch {
			background-color: #25c376 !important;
		}
	}
	.c-radio.pitch {
		border: 1px solid #25c376;
	}
</style>